<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/27 0027
 * Time: 10:37
 */
namespace app\admin\controller;
use think\Controller;

class Builder extends Controller
{
    public function index(){
        $data = [];
        $str = \app\admin\model\Builder::make('table')
            ->addHead(['button alldel','button add'],['批量删除','添加'],['/admin/document/del','/admin/document/show_add'],['',''],['',''])
            ->addColumn('INDEX','checkbox','<input type="checkbox"/>','','text-align: center')
            ->addColumn('id','text','ID','','text-align: center')
            ->addColumn('title','text','名称','','text-align: center')
            ->addColumn('cid_name','text','所属栏目','','text-align: center')
            ->addColumn('model','text','模型','','text-align: center')
            ->addColumn('dir','text','描述','','text-align: center')
            ->addColumn('sort','text','排序','','text-align: center')
            ->addColumn('status','status','状态','','text-align: center')
            ->addRight('操作',['icon edit','icon del'],['/admin/document/show_edit?id=','/admin/document/del'],['编辑','删除'],'','text-align: center')
            ->addData($data)
            ->addPage('test')
            ->fetch();
        $this->assign('str',$str);
        $this->assign('data',count($data));
        return  $this->fetch('public/list');
    }
}